﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading;
using System.Threading.Tasks;

namespace FlightDataBase
{
    class Program
    {
        static void Main(string[] args)
        {

            String sDir = args[0];
            String sFileName = args[1];

            bool bWithManaged = false;
            if (args.Length == 3)
                if (args[2] == "-m")
                    bWithManaged = true;
           
            Directory.SetCurrentDirectory(sDir);

            CFlightDB FlightDB = new CFlightDB("Data Source =10.5.5.234; Initial Catalog = FlightDB; USER ID= admin; PASSWORD=123");
            FlightDB.SetManaged(bWithManaged);
            FlightDB.AddFlightsToDB(sDir + "/", sFileName);  
       
            Console.ReadLine();
        }
    }
}
